/*
 * TermSerializer.cpp
 *
 *  Created on: Nov 26, 2012
 *      Author: m
 */

#include "TermSerializer.h"

namespace physical
{

TermSerializer::TermSerializer()
{
}

TermSerializer::~TermSerializer()
{
}

size_t TermSerializer::serialize( const Term& element, byteStream block )
{
    return m_stringSerializer.serialize( element.getTerm(), block );
}

size_t TermSerializer::deserialize( const byteStream block, Term& element )
{
    std::string termValue;
    size_t usedBytes;

    usedBytes = m_stringSerializer.deserialize( block, termValue );

    element = Term( termValue );

    return usedBytes;
}

size_t TermSerializer::getSize( const Term& element )
{
    return m_stringSerializer.getSize( element.getTerm() );
}

} /* namespace physical */
